<template>
    <div>
        <button v-for="(item, index) in btn_arr" :key="index" @click="fn(index)">{{ item }}</button>
        <CacaoTapSon>
            <template v-slot:page>
                <p>{{ contents_arr[i] }}</p>
            </template>
        </CacaoTapSon>
    </div>
</template>
<script>
import CacaoTapSon from "@/components/CacaoTapSon.vue"
export default {
    components: {
        CacaoTapSon
    },
    data() {
        return {
            i: 0,
            btn_arr: ["娱乐新闻", "军事新闻"],
            contents_arr: ["娱乐新闻内容", "军事新闻内容"]
        }
    },
    methods: {
        fn(index) {
            this.i = index
        }
    },
}
</script>
